snippet lsh "离散化" b
//====== 离散化 begin =====
   int i,j;
    for (i=1;i<=n;i++){
        scanf("%d",&a[i]);
        b[i] = a[i];
    }
    sort(b+1,b+n+1);
    int nn = unique(b+1,b+n+1) - b -1;
    for(i = 1;i<=n;i++){
        a[i] = lower_bound(b+1,b+n+1,a[i]) - b;
    }
//====== 离散化 end =====
endsnippet
